package cn.blogger.pojo;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.List;


/*
*博客下  source blog_uid
* 一级
* 【uid  userId   create   modified   type     content   userInfo  replyList】
* 二级
* 【uid  userId   create   modified   type     content   userInfo  replyList  to_uid to_user_uid first_comment_uid toUserInfo】
*留言板下  source
*
* */
public class TComment implements Serializable {
    //source:  一二级
    //评论人 详细信息 一二级
    //被评论人 详细信息 二级
    //回复列表 一二级
    private Integer uid;//主键  一二级
    private Integer userId;//评论人ID  一二级
    private Integer to_uid;//被评论的评论ID  二级
    private Integer to_user_uid;//被评论的用户ID 二级
    private Integer blog_uid;//被评论的博客ID    一二级，博客模式
    private Timestamp create;// 一二级
    private Timestamp modified;// 一二级
    private boolean type = false;// 一二级
    private Integer first_comment_uid;// 二级
    private String content;//评论内容  一二级
    private String source;//来源
    private List<TComment> replyList;

    //    private User userInfo;
//    private User toUserInfo;
    public TComment() {
    }
    public TComment(Integer userId, Integer blog_uid, boolean type, String content, String source) {
        this.userId = userId;
        this.blog_uid = blog_uid;
        this.create = new Timestamp(System.currentTimeMillis());
        this.modified = new Timestamp(System.currentTimeMillis());
        this.type = type;
        this.content = content;
        this.source = source;
    }

    public TComment(Integer userId, Integer to_uid, Integer to_user_uid, Integer blog_uid, boolean type, String content, String source) {
        this.userId = userId;
        this.to_uid = to_uid;
        this.to_user_uid = to_user_uid;
        this.blog_uid = blog_uid;
        this.type = type;
        this.content = content;
        this.source = source;
    }

    public TComment(Integer userId, Integer blog_uid, Timestamp create, Timestamp modified, boolean type, String content, String source) {
        this.userId = userId;
        this.blog_uid = blog_uid;
        this.create = create;
        this.modified = modified;
        this.type = type;
        this.content = content;
        this.source = source;
    }

    public TComment(Integer uid, Integer userId, Integer blog_uid, Timestamp create, Timestamp modified, boolean type, String content, String source) {
        this.uid = uid;
        this.userId = userId;
        this.blog_uid = blog_uid;
        this.create = create;
        this.modified = modified;
        this.type = type;
        this.content = content;
        this.source = source;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public List<TComment> getReplyList() {
        return replyList;
    }

    public void setReplyList(List<TComment> replyList) {
        this.replyList = replyList;
    }
    public TComment(Integer userId, Integer to_uid, Integer to_user_uid, Integer blog_uid, Timestamp create, Timestamp modified, boolean type, Integer first_comment_uid) {
        this.userId = userId;
        this.to_uid = to_uid;
        this.to_user_uid = to_user_uid;
        this.blog_uid = blog_uid;
        this.create = create;
        this.modified = modified;
        this.type = type;
        this.first_comment_uid = first_comment_uid;
    }

    public TComment(Integer uid, Integer userId, Integer to_uid, Integer to_user_uid, Integer blog_uid, Timestamp create, Timestamp modified, boolean type, Integer first_comment_uid) {
        this.uid = uid;
        this.userId = userId;
        this.to_uid = to_uid;
        this.to_user_uid = to_user_uid;
        this.blog_uid = blog_uid;
        this.create = create;
        this.modified = modified;
        this.type = type;
        this.first_comment_uid = first_comment_uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public void setTo_uid(Integer to_uid) {
        this.to_uid = to_uid;
    }

    public void setTo_user_uid(Integer to_user_uid) {
        this.to_user_uid = to_user_uid;
    }

    public void setBlog_uid(Integer blog_uid) {
        this.blog_uid = blog_uid;
    }

    public void setFirst_comment_uid(Integer first_comment_uid) {
        this.first_comment_uid = first_comment_uid;
    }


    public Timestamp getCreate() {
        return create;
    }

    public void setCreate(Timestamp create) {
        this.create = create;
    }

    public Timestamp getModified() {
        return modified;
    }

    public void setModified(Timestamp modified) {
        this.modified = modified;
    }

    public boolean isType() {
        return type;
    }

    public Integer getUid() {
        return uid;
    }

    public Integer getUserId() {
        return userId;
    }

    public Integer getTo_uid() {
        return to_uid;
    }

    public Integer getTo_user_uid() {
        return to_user_uid;
    }

    public Integer getBlog_uid() {
        return blog_uid;
    }

    public Integer getFirst_comment_uid() {
        return first_comment_uid;
    }

    public void setType(boolean type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "Comment{" +
                "uid:" + uid +
                ", userId:" + userId +
                ", to_uid:" + to_uid +
                ", to_user_uid:" + to_user_uid +
                ", blog_uid:" + blog_uid +
                ", create:" + create +
                ", modified:" + modified +
                ", type:" + type +
                ", first_comment_uid:" + first_comment_uid +
                ", content:'" + content + '\'' +
                ", source:'" + source + '\'' +
                ", replyList:" + replyList.toString() +
                '}';
    }
}

